package com.denlaku.longan.config;

import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import org.springframework.context.annotation.Configuration;

/**
 * 对象序列化是，long类型转换为字符串
 *
 * @author tianx
 */
@Configuration
public class JsonModuleConfig extends SimpleModule {
    public JsonModuleConfig() {
        this.addSerializer(Long.class, ToStringSerializer.instance);
        this.addSerializer(Long.TYPE, ToStringSerializer.instance);
    }
}
